#pragma once

#include "Buffer.h"

class DataInStream
{
public:
	CONSTRUCTOR DataInStream();
	DESTRUCTOR ~DataInStream();

	void SetFileName(const String& fileName);
	String GetFileName();

	void Clear();

	bool Load(Buffer& buffer);
	bool Eof() const;

	s32 GetPosition() const;
	void SetPosition(s32 position, bool fromEnd = false);

	bool Read(c8* buffer, u32 num);

	c8 ReadChar();
	s32 ReadInt();
	f32 ReadFloat();
	u8 ReadByte();
	u16 ReadWord();
	u32 ReadDWord();

protected:
	s32 mPos;
	Buffer mData;
	String mFileName;
};